﻿<Controls:SinacorWindow  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                                    xmlns:Custom="http://schemas.xceed.com/wpf/xaml/datagrid"
                                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                                    mc:Ignorable="d"
                                    xmlns:Model="clr-namespace:Sinacor.UI.Bovespa.Corretagem.Model;assembly=Sinacor.UI.Bovespa.Corretagem.Model"
                                    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
                                    WindowStartupLocation="CenterScreen" 
                                    WindowState="Normal"
                                    Width="790"
                                    Height="730"
                                    Title="{DynamicResource Bovespa.Corretagem.Label.CadastroTipoAplicacaoCorretagem}"
                                    x:Class="Sinacor.UI.Bovespa.Corretagem.View.SmartClient.CadastroTipoAplicacaoCorretagem" 
                                    ModulePlus="False"
                                    ModuleId="ORD">

    <Controls:SinacorExpanderContainer x:Name="ExpanderContainer"
                                       VerticalAlignment="Stretch">


        <Controls:SinacorExpander HorizontalAlignment="Stretch"												
                                  VerticalAlignment="Stretch"												
                                  Header="{DynamicResource Bovespa.Corretagem.Label.Tipos}"
                                  IsExpanded="True" TabIndex="5" AllowExpand="False">
            <Grid>
                <Controls:SinacorDataGrid IsSynchronizedWithCurrentItem="True" 							 		
                                          x:Name="dtgCorretagem"
                                          Width="Auto"
										  Height="Auto"
                                          Margin="0,0,0,0"
                                          AllowDelete="True"
                                          EndingInsert="dtgCorretagem_EndingInsert"
                                          EndingUpdate="dtgCorretagem_EndingUpdate"
                                          Deleting="dtgCorretagem_Deleting"
                                          CancelingInsert="dtgCorretagem_CancelingInsert"
                                          CancelingUpdate="dtgCorretagem_CancelingUpdate"
                                          ItemsSource="{Binding ListaTiposAplicacoesCorretagem}">
                    <Controls:SinacorDataGrid.Columns>

                        <Controls:Column Name="IdentificadorBaseCalculo" 				
                                         AllowInsert="True"                                         
                                         AutoAdjustWidthToContent="True" 
                                         Title="Bovespa.Corretagem.Label.IdtBaseCalculo"
                                         DisplayMemberPath="IdentificadorBaseCalculo"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">

                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorTextBox x:Name="textIdtBaseCalculo" 
                                                             IsRequired="True"
                                                             RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.IdentificadorBaseCalculoObrigatorio"
                                                             CharacterCasing="Upper" 
                                                             MaxLength="1"
                                                             Text="{Binding Path=IdentificadorBaseCalculo, UpdateSourceTrigger=PropertyChanged}"
                                                             HorizontalContentAlignment="Right">
                                    </Controls:SinacorTextBox>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>

                        </Controls:Column>

                        <Controls:Column Name="Descricao" 		
                                         AllowInsert="True"
                                         AllowUpdate="True"
                                         AutoAdjustWidthToContent="False"
                                         Width="250"
                                         Title="Bovespa.Corretagem.Label.Descricao"
                                         DisplayMemberPath="Descricao"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">

                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorTextBox x:Name="textDescricao" 
                                                             IsRequired="True"
                                                             RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.DescricaoObrigatoria"
                                                             MaxLength="20"
                                                             Text="{Binding Descricao, UpdateSourceTrigger=PropertyChanged}"
                                                             HorizontalContentAlignment="Right">
                                    </Controls:SinacorTextBox>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>

                        </Controls:Column>

                        <Controls:Column Name="TpBaseCalculo" 	
                                         Title="Bovespa.Corretagem.Label.TpBaseCalculo"
                                         IsRequired="True"
                                         RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.TipoBaseCalculoObritatorio"
                                         AllowInsert="True"
                                         AllowUpdate="True"
                                         HorizontalCellAlignment="Left"
                                         DisplayMemberPath="TipoBaseCalculo"
                                         CellInsertTemplate="{Binding Path=CellUpdateTemplate, RelativeSource={RelativeSource Self}}">
                        </Controls:Column>

                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>
            </Grid>
        </Controls:SinacorExpander>
    </Controls:SinacorExpanderContainer>
</Controls:SinacorWindow>